#pragma once

#include <pimstore.h>
#include <imaging.h>
#include "Settings.h"

class PoomPictureLoader
{
public:
  static bool GetContactPicture(IPOutlookApp2* polApp, CEOID contactOid, HDC windowDC, HBITMAP& hbm, int& width, int& height);
  static bool SetContactPicture(IPOutlookApp2* polApp, CEOID contactOid, const TCHAR* sFile, EPicSaveType size = pstDefault);

private:
  static HRESULT GetStreamSize(IStream* pStream, ULONG& ulSize);
  static HRESULT GetBitmapFromStream(IStream* pStream, HDC windowDC, HBITMAP& hBitmap, UINT& width, UINT& height);
  static HRESULT GetBitmapFromImage(IImage * pImage, HDC windowDC, HBITMAP& hBitmap, COLORREF crBackColor);
};
